//
//  Engine.m
//  CarHome
//
//  Created by lanou3g on 15-4-27.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "Engine.h"
#import "EngineSpecification.h"

@implementation Engine

- (instancetype)init
{
    self = [super init];
    if (self) {
        _speclist = [[NSMutableArray alloc] initWithCapacity:0];
    }
    return self;

}

- (void)setSpeclist:(NSMutableArray *)speclist {
    for (NSMutableDictionary *item in speclist) {
        EngineSpecification *es = [[EngineSpecification new] autorelease];
        [es setValuesForKeysWithDictionary:item];
        [_speclist addObject:es];
    }
}

- (NSString *)description
{
    return [NSString stringWithFormat:@"%@ %@ %@", _name, _type, _speclist];
}

- (void)dealloc
{
    [_name release];
    [_speclist release];
    [_type release];
    
    [super dealloc];
}

@end
